package com.ican.oc.dao;

import org.springframework.stereotype.Repository;

import com.ican.oc.common.hibernate.OcHibernateDao;
import com.ican.oc.domain.OcProductImage;

@Repository("ocProductImageDao")
public class OcProductImageDao extends OcHibernateDao<OcProductImage, Integer> {

    public OcProductImage findOcProductImage(Integer productId, String image) {
        String hql = "from OcProductImage where productId = " + productId + " and image = '" + image + "'";
        return this.findUnique(hql);
    }
    
    public void updateOcProductImage(Integer productImageId, String image){
        String hql = "update OcProductImage set image = '" + image + "' where productImageId = " + productImageId;
        this.batchExecute(hql);
    }
}
